macos: remove synthesize_motion helper
authorChristian Hergert <chergert@redhat.com>
Thu, 5 Nov 2020 00:58:50 +0000 (16:58 -0800)
committerChristian Hergert <chergert@redhat.com>
Thu, 5 Nov 2020 00:58:50 +0000 (16:58 -0800)
We can use gdk_surface_request_motion() now instead of our extra
helper to do essentially the same thing.

gdk/macos/gdkmacosdisplay-private.h
gdk/macos/gdkmacosdisplay-translate.c
gdk/macos/gdkmacosdisplay.c

index 9f45a2e2009ac70b3c9942420951ba0da71552e6..630daceae0cebd44b396d5accb18fb7df388a975 100644 (file)
@@ -136,8 +136,6 @@ void             _gdk_macos_display_add_frame_callback             (GdkMacosDisp
                                                                     GdkMacosSurface *surface);
 void             _gdk_macos_display_remove_frame_callback          (GdkMacosDisplay *self,
                                                                     GdkMacosSurface *surface);
-void             _gdk_macos_display_synthesize_motion              (GdkMacosDisplay *self,
-                                                                    GdkMacosSurface *surface);
 NSWindow        *_gdk_macos_display_find_native_under_pointer      (GdkMacosDisplay *self,
                                                                     int             *x,
                                                                     int             *y);
index 849d433634f4393720f2f9e18f70d98b38480644..f895db9686d1b07de3186dc7e100caaeb2c431cf 100644 (file)
@@ -1155,41 +1155,6 @@ _gdk_macos_display_translate (GdkMacosDisplay *self,
   return ret;
 }
 
-void
-_gdk_macos_display_synthesize_motion (GdkMacosDisplay *self,
-                                      GdkMacosSurface *surface)
-{
-  GdkModifierType state;
-  GdkEvent *event;
-  GdkSeat *seat;
-  NSPoint point;
-  GList *node;
-  int x;
-  int y;
-
-  g_return_if_fail (GDK_IS_MACOS_DISPLAY (self));
-  g_return_if_fail (GDK_IS_MACOS_SURFACE (surface));
-
-  seat = gdk_display_get_default_seat (GDK_DISPLAY (self));
-  point = [NSEvent mouseLocation];
-  _gdk_macos_display_from_display_coords (self, point.x, point.y, &x, &y);
-
-  state = _gdk_macos_display_get_current_keyboard_modifiers (self) |
-          _gdk_macos_display_get_current_mouse_modifiers (self);
-
-  event = gdk_motion_event_new (GDK_SURFACE (surface),
-                                gdk_seat_get_pointer (seat),
-                                NULL,
-                                get_time_from_ns_event ([NSApp currentEvent]),
-                                state,
-                                x,
-                                y,
-                                NULL);
-  node = _gdk_event_queue_append (GDK_DISPLAY (self), event);
-  _gdk_windowing_got_event (GDK_DISPLAY (self), node, event,
-                            _gdk_display_get_next_serial (GDK_DISPLAY (self)));
-}
-
 void
 _gdk_macos_display_send_button_event (GdkMacosDisplay *self,
                                       NSEvent         *nsevent)
index 665a567e70ec0e3399c278f7d171703a6c7da9b3..f042b4a358aca6d66e5e405c92c522a46b3adcaf 100644 (file)
@@ -512,7 +512,7 @@ _gdk_macos_display_surface_became_key (GdkMacosDisplay *self,
    * ("is not key").  We send a dummy motion notify event now, so that
    * everything in the window is set to correct state.
    */
-  _gdk_macos_display_synthesize_motion (self, surface);
+  gdk_surface_request_motion (surface);
 }
 
 void